<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="<%=request.getContextPath()%>/common/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/common/calender.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/common/FSS.js" ></script>

<script type="text/javascript">

function fnView(id){
	var strUrl = "<s:url action="view" namespace="/experience"><s:param name="experience.experienceId"/></s:url>";
	location.href = (strUrl + id);
}

function fnSearch(){
	document.search.submit();
}

</script>
</head>
<body id="page3">
<div class="tail-right"></div>
<div class="tail-right-top"></div>
<div class="tail-top">
  <div class="tail-bottom">
    <div class="tail-bg">
      <div class="top-bg">
        <div class="tail-right-bot"></div>
        <div class="bot-bg">
          <div id="main">
            <!-- header -->
            <s:form name="login" action="/fssProject/Login" theme="simple">
            <div id="header">
              <h1><a href="<%=request.getContextPath()%>">fss</a></h1>
              <ul class="top-login">
              <s:if test="#session.user_login==null">
                <li><img alt="" src="../images/userid.gif" /></li>
                <li><input type="text" name="user.userId" id="user_name" /></li>
                <li><img alt="" src="../images/password.gif" /></li>
                <li><input type="password" name="user.pwd" id="password" /></li>
                <li><a class="loginbutton" href="javascript:fnLogin();"></a></li>
                <li><a class="registerbutton" href="/fssProject/user/initRegister" ></a></li>
              </s:if><s:else>
              	<li><h4><s:property value="#session.user_login.displayName"/>,Welcome!</h4></li>
              	<li><a class="mypagebutton" href="/fssProject/user/myInfo"></a></li>
                <li><a class="logoutbutton" href="/fssProject/Logout"></a></li>
                </s:else>
              </ul> 	
            </div>
            </s:form>
            <div class="extra-img"><img alt="" src="../images/extra-img.png" class="png"/></div>
            <div class="wrapper">
              <!-- nav -->
              <div id="nav">
                <ul>
                 <li><a href="/fssProject/mainPage">ホーム</a></li>
                  <li><a href="/fssProject/experience/list"><s:property value="#session.btn1.content"/></a></li>
                  <li><a href="/fssProject/secondHand/list"><s:property value="#session.btn2.content"/></a></li>
                  <s:if test="#session.user_login.userId in {'fss_admin1','fss_admin2','fss_admin3'}">
                  <li><a href="/fssProject/user/userManage">ユーザ管理</a></li>
                  <li><a href="/fssProject/cmsContent/editCMSContent">CMS変更</a></li>
                  </s:if>
                </ul>
              </div>
              <!-- content -->
              <div id="content">
                <div class="section">
                  <!-- box begin -->
                  <div class="box">
                    <div class="left-top-corner png">
                      <div class="right-top-corner png">
                        <div class="border-top png"></div>
                      </div>
                    </div>
                    <div class="border-left png">
                      <div class="border-right png">
                        <div class="inside png">
                          <h2>経験リスト</h2>
                          
                          <form id="contacts-form" name="search" method="post" action="listByCondition">
                            <fieldset>
                                <div class="field">
                                    <label>種類:</label>
                                    <s:select list="experienceTypeList"
						listKey="typeId" listValue="typeName" headerKey="0" headerValue="" name="experienceType.typeId"
						cssClass="experience"/>
                                </div>
                                <div class="field">
                                	<label>開始日:</label>
                                	<s:textfield name="fromDateStr" onfocus="HS_setDate(this)"/>
                              	</div>
                              	<div class="field">
                                	<label>終了日:</label>
                                	<s:textfield name="toDateStr" onfocus="HS_setDate(this)"/>
                              	</div>  
                            </fieldset>
                          </form>
                          
                          <div class="field">   
                          <a class="experienceSerach" href="javascript:fnSearch();"></a>
                          <s:if test="#session.user_login!=null">
                          <a class="new" href="initAdd"></a>
                          </s:if> 
                          </div>
                              
                          <ul class="articles">
                          <%int i=1; %>
                            <s:iterator id="experience" status="or" value="experienceList">
                           		 <div class="block">
                              		<h3> <%=i++ %> <s:property value="#experience.title"/></h3>
                              		<h4>投稿時間：<s:date name="#experience.createdTime" format="yyyy-MM-dd"/></h4>
                              		<div class="messageblock">
                              		<s:property value="#experience.content" escape="false"/> 
                              		</div>
                              		... <a href="javascript:fnView(<s:property value='#experience.experienceId'/>);">Read More</a>
                              		<h4>コメント数：<s:property value="#experience.commentCounter" /></h4></div>
                              </s:iterator>
                          </ul>
                          
                        </div>
                      </div>
                    </div>
                    <div class="left-bot-corner png">
                      <div class="right-bot-corner png">
                        <div class="border-bot png"></div>
                      </div>
                    </div>
                  </div>
                  <!-- box end -->
                </div>
              </div>
            </div>
          </div>
          <!-- footer -->
          <div id="footer">
            <div class="indent">
              <div class="fleft">Copyrights - Ritsumeikan University</div>
              <div class="fright">Designed by: <a href="http://www.ritsumei.jp/ise/index_j.html"><img src="../images/designer.gif" /> </a>Provider</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>